package common;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author cyt
 * @create 2020-10-13 15:53
 */
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
public class TestData<Inner> implements Comparable<TestData> {
    private Integer age;
    private String name;
    private List<Inner> inners;

    @Override
    public int compareTo(TestData o) {
        if (o.age > this.age) {
            return 1;
        } else if (o.age.equals(this.age)) {
            return 0;
        } else {
            return -1;
        }
    }
}
